package com.ruoyi.manager.service.impl.impl;

import com.ruoyi.manager.mapper.TeacherAnalysisMapper;
import com.ruoyi.manager.service.TeachAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public class TeachAnalysisServiceImpl implements TeachAnalysisService {

    @Autowired
    TeacherAnalysisMapper teacherAnalysisMapper;

    @Override
    public List<Map<String, Object>> listClassesInfor() {

        return teacherAnalysisMapper.listClassesInfor();
    }


    @Override
    public List<Map<String, Object>> listClassesAvgScore() {

        return teacherAnalysisMapper.listClassesAvgScore();
    }

    @Override
    public List<Map<String,Object>> findClassCore(){

        return teacherAnalysisMapper.findClassCore();
    }

    @Override
    public Map<String,Object> avgInfor(){
        Map<String,Object> map1 = teacherAnalysisMapper.avgInfor();
        return map1;
    }

    @Override
    public Map<String, Object> exInfo() {
        //核心作业完成率
        Map<String,Object> map1 = teacherAnalysisMapper.getCoreExCompletRate();
        //核心作业提交率
        Map<String,Object> map2 = teacherAnalysisMapper.getCoreExCommitRate();
        //完成率低于40%占比
        Map<String,Object> map3 = teacherAnalysisMapper.getCoreExLt40Rate();
        //完成率高于80%
        Map<String,Object> map4 = teacherAnalysisMapper.getCoreExGt80Rate();

        map1.putAll(map2);
        map1.putAll(map3);
        map1.putAll(map4);

        return map1;
    }

    @Override
    public List<Map<String, Object>> listStudentCoreTaskCompleteRateLessForty() {
        return teacherAnalysisMapper.listStudentCoreTaskCompleteRateLessForty();
    }

    @Override
    public Map<String, Integer> listStudentLevelCount() {
        return teacherAnalysisMapper.listStudentLevelCount();
    }

    @Override
    public List<Map<String, Object>> workNum() {
        return teacherAnalysisMapper.workNum();
    }

    @Override
    public List<Map<String, Object>> assessNum() {
        return teacherAnalysisMapper.assessNum();
    }

    @Override
     public List<Map<String,Object>>listStudentplace(){
        return teacherAnalysisMapper.listStudentplace();
    };

    @Override
    public List<Map<String,Object>>listStudentAddress(){
        return teacherAnalysisMapper.listStudentAddress();
    }

}
